const App = getApp();

Component({
  properties: {
    itemList: Array,
    page: String
  },
  methods: {
    make(e) {
      let route = getCurrentPages()[0].route;
      let status = e.currentTarget.dataset.status;
      let id = e.currentTarget.id;
      if (status == 0) {
        let title;
        if (route == 'pages/makechef/makechef'){
          title = '抱歉，厨师已被预约！'
        }else{
          title = '抱歉，包间已被预定！'
        }
        wx.showToast({
          title: title,
          icon: 'none'
        })
        return
      }
      this.triggerEvent('make',id)
    },
    setId(e){
      let id = e.currentTarget.dataset.id;
      this.triggerEvent('getCateId', id)
    }
  }
})